package dk.itu.mmad.travelapp;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class CheckinActivity extends Activity {

static String chIn;
String tag = "CheckIn";

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_checkin);
		Button button  = (Button) findViewById(R.id.checkinbutton);
		button.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(CheckinActivity.this, CheckoutActivity.class);
				EditText ed = (EditText) findViewById(R.id.checkinstation);
				chIn = ed.getText().toString();
				Log.i(tag, chIn + " Checked in");
				intent.putExtra("ci", chIn);
				startActivity(intent);
			}
		});
	}
	

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_checkin, menu);
		return true;
	}

}
